package com.fadadianqi.goods.dao;

import com.fadadianqi.commons.BaseDAO;
import com.fadadianqi.goods.model.Goods;
import com.yeqiangwei.commons.util.Pagination;

import java.util.List;

public interface GoodsDAO extends BaseDAO<Goods> {

    List<Goods> findByBrandId(String brandId, Pagination pagination);

    List<Goods> findByCategoryId(String categoryId, Pagination pagination);

    List<Goods> findByBrandIdAndCategoryId(String brandId, String categoryId, Pagination pagination);

    List<Goods> findAll(Pagination pagination);

    Integer countByBrandIdAndCategoryId(String brandId, String categoryId);

    Integer countByCategoryId(String categoryId);

    Integer countByBrandId(String brandId);

    Integer countAll();

    Goods getByNameAndBrandIdAndCategoryId(String name, String brandId, String categoryId);

    int countAllNotIndexed();

    List<Goods> findAllNotIndexed(Pagination pagination);

    Goods getByUniqueNameAndBrandIdAndCategoryId(String uniqueName,
                                                 String brandId, String categoryId);

}
